package cn.pegasus.teamwork.pegasus.controller;

import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import cn.iyizhan.teamwork.base.util.PageObject;
import cn.pegasus.teamwork.manager.controller.BaseManagerController;
import cn.pegasus.teamwork.pegasus.entity.BussUcenterArea;
import cn.pegasus.teamwork.pegasus.entity.BussUserOpinion;
import cn.pegasus.teamwork.pegasus.mapper.BussUserOpinionMapper;
import cn.pegasus.teamwork.pegasus.service.BussUserOpinionService;

/**
 * 申述
 * @author 40854
 *
 */
@Controller
@RequestMapping("/opinion")
public class OpinionController extends BaseManagerController<BussUserOpinion, BussUserOpinionMapper>{

	private static final Logger logger = LoggerFactory.getLogger(OpinionController.class);
	
	@Autowired
	private BussUserOpinionService opinionService;
	
	/**
	 * 查询申诉列表
	 */
	@RequestMapping(value="/list")
	public ModelAndView list(@RequestParam Map<String, Object> map){
		ModelAndView view = new ModelAndView("opinion/opinion-list");
		if(map.isEmpty()){
			map.put("pageData", 10);
			map.put("curPage", 1);
		}
		try{
			PageObject<BussUserOpinion> dicList = opinionService.PageList(map);
			 view.addObject("list", dicList);
			 view.addObject("map", map);
		}catch(Exception e){
			logger.error("查询申诉列表信息异常",e.getMessage());
		}
		return view;
	}
}
